package cn.tedu.feign;

import cn.tedu.pojo.User;
import cn.tedu.util.JsonResult;
import org.springframework.stereotype.Component;

@Component
public class UserFeignServiceFB implements UserClient{
    @Override
    public JsonResult<User> getUser(Integer userId) {

        if(Math.random()<0.5){
            User user = new User(1,"缓存用户n","缓存密码8");
            return JsonResult.ok().data(user);
        }
        return JsonResult.err().msg("获取用户Id失败");
    }

    @Override
    public JsonResult addScore(Integer userId, Integer score) {
        return JsonResult.err().msg("增加积分失败");
    }
}
